﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>报表管理</title>
    <link href="App_Themes/CSS/default.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/CSS/style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
         // 操作cookie
        function saveCookie() {
            return false;
            var c = pState + ":" + tState + ":";
            for (var i = 0; i < gHis.length; i++) {
                if (i > 0) c += ".";
                c += gHis[i];
            }
            c += ":";
            for (var i = 0; i < iHis.length; i++) {
                if (i > 0) c += ".";
                c += iHis[i];
            }
            c += ":" + menuId;
            //7天的有效期
            var expireDate = new Date();
            expireDate.setDate(expireDate.getDate() + 7);
        }
        //动态改变图片
        function imgOver() {
            var obj = event.srcElement;
            if (obj.src.lastIndexOf("-over") < 0)
                obj.src = obj.src.substring(0, obj.src.lastIndexOf(".")) + "-over.gif";

        }
        function imgOut() {
            var obj = event.srcElement;
            if (obj.src.lastIndexOf("-over") > 0)
                obj.src = obj.src.substring(0, obj.src.lastIndexOf("-")) + ".gif";

        }
        //点击左方的缩放按钮
        function panelSwitchClicked() {
            pStateOld = document.getElementById("left_panel").style.display == "none" ? "close" : "open";
            switchBar("left_panel");
            pState = document.getElementById("left_panel").style.display == "none" ? "close" : "open";
            event.srcElement.src = event.srcElement.src.replace(pStateOld, pState);
            saveCookie();
            if (pStateOld == "close") {
                document.getElementById('mainFrame').width = window.screen.width - 281; //屏幕宽度减掉开关按钮和左侧树宽度
                //document .getElementById ('tdMainFrame').width = window.screen.width - 300; 
            }
            if (pStateOld == "open") {
                document.getElementById('mainFrame').width = window.screen.width - 27;//屏幕宽度减掉开关按钮宽度
                //document .getElementById ('tdMainFrame').width = window.screen.width - 28; 
            }
        }
        //缩放隐藏
        function switchBar(objId) {
            var obj = document.getElementById(objId);

            if (!obj)
                alert("对不起，页面出现了异常");
            if (obj.style.display == "none") {
                obj.style.display = "block";
            }
            else {
                obj.style.display = "none";
            }
        }
        //改变左边窗口的大小
        function leftPanelResize() {
            var leftPanel = document.getElementById("left_panel");
            leftPanel.width = event.x;
        }
        //获取分栏按钮状态,如果为隐藏，就返回false,如果显示就返回true
        function getSwitchState() {
            pStateOld = document.getElementById("left_panel").style.display == "none" ? "close" : "open";
            if (pStateOld == "close") {
                return true;
            }
            else {
                return false;
            }
        }

        /*
        *  获取URL中的参数的值
        *  @param para 参数名称
        */
        function getValueOfURLParamter(para) {
            var value = '';
            var args = window.location.href.substring(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < args.length; i++) {
                if (args[i].substring(0, args[i].indexOf('=')).toUpperCase() == para.toUpperCase()) {
                    value = args[i].substring(args[i].indexOf('=') + 1);
                    break;
                }
            }
            return value;
        }
        function InitPage() {
            var operateid = getValueOfURLParamter('operateid');
            if (operateid == '' || operateid == null) {
                operateid = 2;
            }
            document.getElementById('leftTree').src = 'LeftTree.aspx?operateid=' + operateid;
        }
    </script>

</head>
<body style="margin: 0px; overflow :hidden ;" onload="InitPage();">
    <form id="form1" runat="server">
   <table style="width: 100%; height: 100%; border: 0px;" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center" colspan="3" style="background-image: url('images/01_01.gif');
                height: 69px; background-repeat: no-repeat">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td id="left_panel" valign="top" style =" height :550px; width :224px; text-align :left ;">
                <iframe src="" id="leftTree" height="100%" width="254px" frameborder="0" style="overflow: hidden;">
                </iframe>
            </td>
            <td style="width: 7px; height: 100%; background-image: url('images/01_04.gif');
                text-align:left">
                <img id="imgSwitch" style="cursor: hand" alt="" src="images/switch-panel-open.gif"
                    onclick="panelSwitchClicked();" onmouseover="imgOver();" onmouseout="imgOut();" />
            </td>
            <td valign="top" align="left" style="height: 550px;text-align: left; overflow-x:hidden;">
                <iframe src="Right_Blank.aspx" id="mainFrame" height="100%" width="100%" frameborder="0" style ="text-align: left;"></iframe>
            </td>
        </tr>
    </table>
    </form>

    <script type="text/javascript">
        (function() {
            var w = window.screen.width;
            var h = window.screen.height;
            document.body.style.width = w - 22;
            //document.body.style.height = h - 180;
            //document.getElementById('mainFrame').style.width = w - 271;
            //document.getElementById('mainFrame').style.height = (h == 768 ? h - 245 : h - 255);
        })();
    </script>

</body>
</html>
